#include "EnumNode.h"

#include "Output/Console.h"

#include "ScriptCompiler/Token/Token.h"
#include "ScriptCompiler/AST/AccessLevelNode.h"
#include "ScriptCompiler/AST/EnumValueNode.h"


void CEnumNode::DebugPrint(int32_t InDepth)
{
    //print blank spaces for depth
    for(int32_t i=0;i<InDepth;i++)
    {
        WH::Print(U"\t");
    }

    //print access level
    if(AccessLevel.HasValue())
    {
        AccessLevel.GetValue()->DebugPrint(InDepth);
    }

    //print enum name
    WH::Print(U"enum ");
    WH::Print(Name->ToString());

    //print { with depth
    WH::Print(U"\n");
    for(int32_t i=0;i<InDepth;++i)
    {
        WH::Print(U"\t");
    }
    WH::Print(U"{\n");

    //print enum values
    for(int32_t i=0; i<Values.Num(); ++i)
    {
        Values[i]->DebugPrint(InDepth+1);

        if(i!=Values.Num()-1)
        {
            WH::Print(U",\n");
        }
        else
        {
            WH::Print(U"\n");
        }
    }

    //print } with depth
    for(int32_t i=0;i<InDepth;++i)
    {
        WH::Print(U"\t");
    }
    WH::Print(U"}\n");
}
